<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div>
    <script src="../lib/react.js"></script>
    <script src="../lib//react-dom.js"></script>
    <script src="../lib//babel.js"></script>
    <script type="text/babel">
        /* 电影列表案例实现 */    

        class App extends React.Component {
            // 组件数据
            constructor(){
                super()
                this.state = {
                    movies:["逃生","咒怨","隔山有眼","午夜凶铃","黑色星期五"]
                }

            }
            // 组件方法

            // 组件渲染
            render(){
                return (
                    <div>
                        <h2>电影列表</h2>
                        {this.state.movies.map(item=><li>{item}</li>)}
                    </div>
                )
            }
        }
        const root = ReactDOM.createRoot(document.querySelector("#root"))
        root.render(<App />)
        


    </script>
</body>
</html>